#ifndef _MAP_ASM_H_
#define _MAP_ASM_H_

#include "vec2.h"

typedef struct {
	vec2 v1,v2;
} mapWall;

typedef struct {
	vec2 pos;
	int data; // Used to identify the object.
} mapObj;

// Init
void mapInit(void);
// Erases current map
void mapErase(void);

// Adds a wall to the map. If it is close to an existing wall, it gets merged.
void mapAddWall(mapWall* w);
// Adds an object tot he map. If it is close to an existing object, it gets merged.
void mapAddObj(mapObj* o);
// Sets the position and facing of the robot in the map.
void mapSetPos(vec2 pos, vec2 facing);

// Gets the amount of walls and objects in the map
unsigned int mapGetWallCount(void);
unsigned int mapGetObjCount(void);
// Gets walls and objects from the map. The pointer points to an array of size mapGetXCount().
mapWall* mapGetWall(void);
mapObj* mapGetObj(void);
// Gets the estimated position and facing of the robot and writes it to the passed pointers.
void mapGetPos(vec2* pos, vec2* facing);

#endif

